" All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by
" the call to :runtime you can find below.  If you wish to change any of those
" settings, you should do it in this file (/etc/vim/vimrc), since debian.vim
" will be overwritten everytime an upgrade of the vim packages is performed.
" It is recommended to make changes after sourcing debian.vim since it alters
" the value of the 'compatible' option.

" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim

" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'.  Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
"set compatible

" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
if has("syntax")
    syntax on
endif

" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
"set background=dark

" Uncomment the following to have Vim jump to the last position when
" reopening a file
"if has("autocmd")
"  au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
"endif

" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
"if has("autocmd")
"  filetype plugin indent on
"endif

" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
"set showcmd		" Show (partial) command in status line.
"set showmatch		" Show matching brackets.
"set ignorecase		" Do case insensitive matching
"set smartcase		" Do smart case matching
"set incsearch		" Incremental search
"set autowrite		" Automatically save before commands like :next and :make
"set hidden		" Hide buffers when they are abandoned
"set mouse=a		" Enable mouse usage (all modes)

" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
    source /etc/vim/vimrc.local
endif

set nu					"显示行号
set showcmd 				"输入的命令显示出来
set foldenable				"允许折叠
set autoindent				"自动缩进
set cindent					"
set tabstop=4				"TAB键宽度
set softtabstop=4			"
set shiftwidth=4			"
set expandtab				"用空格代替TAB
"set ignorecase				"搜索忽略大小写
set langmenu=zh_CN.UTF-8	"语言设置为中文
set helplang=cn				"
set cmdheight=2				"状态行高度为2
"为特定的文件做匹配设置
filetype on					"检测文件类型
filetype plugin on			"载入文件类型的插件
filetype indent on			"为特定文件类型载入相关缩进文件
syntax on
set mouse=a					"开启鼠标
set showmatch				"高亮显示匹配的括号
set smartindent				"为c语言提供自动缩进
set hlsearch				"高亮显示搜索
set encoding=utf-8
set termencoding=utf-8
set fileencodings=utf-8,gbk
let &termencoding=&encoding

"设置switch和case对其
set cino+=:0

"Tlist自动开启，在窗口左侧
let Tlist_Auto_Open=1
let Tlist_Use_Right_Window=0
let Tlist_Show_One_File=1

"F3快速开启/关闭NERDTree
map <F3> :NERDTreeMirror<CR>
map <F3> :NERDTreeToggle<CR>

"NERDTree在窗口右侧
let NERDTreeWinPos=1

syntax enable
colorscheme monokai
"设置支持256色彩
set t_Co=256
autocmd BufNewFile,BufRead * :syntax match cfunctions "\<[a-zA-Z_][a-zA-Z_0-9]*\>[^()]*)("me=e-2
autocmd BufNewFile,BufRead * :syntax match cfunctions "\<[a-zA-Z_][a-zA-Z_0-9]*\>\s*("me=e-1

"函数颜色81
hi cfunctions ctermfg=81


"高亮光标所在行
set cursorline
"高亮光标所在列
"set cursorcolumn
"
au BufRead,BufNewFile *.http setlocal ft=http "syntax highlight for http.vim 

"ranbow.vim设置
"文件类型如下则加载ranbow
"au FileType c,cpp,objc,objcpp,lua,html,htm,py call rainbow#load()
"所有文件都加载ranbow
"let g:rainbow_active=1
"设置不同文件使用的括号类型和括号颜色

"let g:rainbow_load_separately = [
"    \ [ '*' , [ ['(', ')'], ['\[', '\]'], ['{', '}'] ] ],
"    \ [ '*.tex' , [['(', ')'], ['\[', '\]']] ],
"    \ [ '*.{c,cpp}' , [['(', ')'], ['\[', '\]'], ['{', '}']] ],
"    \ [ '*.{html,htm}' , [['(', ')'], ['\[', '\]'], ['{', '}'], ['<\a[^>]*>', '</[^>]*>']] ],
"    \ ]
"
"let g:rainbow_guifgs = ['RoyalBlue3', 'DarkOrange3', 'DarkOrchid3', 'FireBrick']
"let g:rainbow_ctermfgs = ['white', 'lightgreen', 'yellow', 'red', 'magenta']
